/**
 * 
 */
package com.shequan.pbinfo.service.impl;

import java.util.List;

import com.shequan.common.bean.ResultDataStruct;
import com.shequan.common.bean.ViewTextConstans;
import com.shequan.pbinfo.bean.pojo.WorkJob;
import com.shequan.pbinfo.dao.WorkJobDAO;
import com.shequan.pbinfo.service.WorkJobService;

/**
 * <P>
 * Copyright 2012.
 * </p>
 * <P>
 * All Rights Reserved.
 * </p>
 * @author YuJF
 * @version 1.0, 2012-5-21
 * @see com.shequan.pbinfo.service.impl.WorkJobServiceImpl 
 * @since 1.0
 */
public class WorkJobServiceImpl implements WorkJobService {
	private WorkJobDAO workJobDao;

	public void setWorkJobDao(WorkJobDAO workJobDao) {
		this.workJobDao = workJobDao;
	}

	/* (non-Javadoc)
	 * @see com.shequan.pbinfo.service.WorkJobService#queryAllWorkJob()
	 */
	public ResultDataStruct<List<WorkJob>> queryAllWorkJob() {
		ResultDataStruct<List<WorkJob>> rds=new  ResultDataStruct<List<WorkJob>>();
		List<WorkJob> workJobs=workJobDao.selectAll();
		if(workJobs==null||workJobs.size()==0){
			rds.setBusiSuccess(false);
			rds.setMessage(ViewTextConstans.WORK_JOB_IS_NULL_MSG);
		}else{
			rds.setBusiSuccess(true);
			rds.setData(workJobs);
		}
		rds.setSuccess(true);
		return rds;
	}
}
